#include<iostream>

using namespace std;
int a[24];
int main()
{
    for (int i = 0; i < 24; i++) cin >> a[i];
    int x;
    while (cin >> x, x >= 0 && x <= 23)
    {
        cout << a[x] << " ";
        if (a[x] > 50) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}